﻿using Microsoft.AspNetCore.Mvc.RazorPages;
using MyHellCalendar.Core;
using MyHellCalendar.Tool;
using System;

namespace MyHellCalendar.Web.Pages
{
    public class IndexModel : PageModel
    {
        private string xmlFilePath
        {
            get
            {
                var path = AppDomain.CurrentDomain.BaseDirectory + "Configuration{0}BaseHellData.xml";
                return string.Format(path, System.IO.Path.DirectorySeparatorChar);
            }
        }

        public void OnGet()
        {
            HellInfos = XmlHelper.LoadFromXml<HellInfo>(xmlFilePath);
        }

        public HellInfo? HellInfos { get; set; }
    }
}